<template>

	<view>
		<bg-video></bg-video>
		<cu-custom bgColor="bg-main" :isBack="true">
			<block class="text-white" slot="content">房间详细</block>
		</cu-custom>

		<view class="bg-white">
			<view class="padding solid-bottom flex justify-start align-baseline">
				<view class="text-main title">
					<text class="text-xxl  ">
						<text class="iconfont icon-fangjian"></text>
					</text>
					<text>房间详细</text>
				</view>
			</view>

			<view class="">
				<view class="cu-form-group">
					<view class="title">门店</view>
					<view>{{md.mdmc}}</view>
				</view>
				<view class="cu-form-group">
					<view class="title">房间名</view>
					<view>{{fj.fjmc}}</view>
				</view>
				<view class="cu-form-group">
					<view class="title">面积</view>
					<view>{{fj.mj}}㎡</view>
				</view>
				<view class="cu-form-group">
					<view class="title">评分</view>
					<view><uni-rate v-model="fj.rate"></uni-rate></view>
				</view>
				<view class="cu-form-group">
					<view class="title">类型</view>
					<view>{{tp[fj.tp]}}</view>
				</view>
				<view class="cu-form-group">
					<view class="title">功能</view>
					<view>{{func[fj.func]}}</view>
				</view>
				<view class="">
					<swiper class="screen-swiper" :indicator-dots="false" :circular="true" :autoplay="true"
						interval="2000" duration="500">
						<swiper-item v-for="(item,index) in fj.imgs" :key="index">
							<image :src="item" mode="aspectFill"></image>
						</swiper-item>
					</swiper>
				</view>

				<view class="padding">
					<button @tap="toYy" class="cu-btn bg-main">预约</button>
				</view>
			</view>
		</view>	

	</view>
</template>

<script>
	export default {
		
		data: function() {
			return {
				md: {},
				fj: {},
				func: {},
				tp: {}
			}
		},
		created: function() {
			this.func = this.constant.roomfunc.ROOMFUNC;
			this.tp = this.constant.roomtp.ROOMTP;
		},
		onLoad: function(option) {
			this.fj.fjid = option.fjid;
			this.loadFj();
		},
		methods: {
			loadFj: function() {
				
				this.api("/fj/info/get").send({
					fjid: this.fj.fjid
				}).then(data => {
					this.fj = data.fj;
					this.md = data.md;
				});
			},
			toYy: function() {
				uni.navigateTo({
					url: `/pages/cyy/yy/new?fjid=${this.fj.fjid}&mdid=${this.fj.mdid}`
				})
			}
			
		}
		
	}
</script>

<style>
	.roomtitle {
		position: absolute;
		bottom: 0;
		width: 100%;
		display: flex;
		align-items: start;
		min-height: 100rpx;
		justify-content: space-between;
		flex-direction: column;
	}

	.roomtitle text {
		padding: 0.3rem;
	}
</style>